<link rel="stylesheet" href="CSS/map.css">
<div class="map-wrapper" v-cloak>
    <button-group class="map-tool" style="position: absolute">
        <i-button :loading="truckButton.loading" :type="truckButton.type" v-on:click="switchTruck" icon="android-car">显示送货车</i-button>
        <i-button :loading="bournButton.loading" :type="bournButton.type" v-on:click="switchBourn" icon="disc">显示配送点</i-button>
        <i-button :loading="factoryButton.loading" :type="factoryButton.type" v-on:click="switchFactory" icon="ios-home">显示厂区</i-button>
        <i-button :loading="obstacleButton.loading" :type="obstacleButton.type" v-on:click="switchObstacle" icon="minus-circled">显示障碍点</i-button> 
        <i-button icon="ios-close-outline" v-on:click="clearAllLayer">清除所有图层</i-button>
    </button-group>
    <!-- <i-input class="map-search" on-click="getSearchList" style="position: absolute;width: 240px;" v-model="searchValue" icon="ios-search-strong" placeholder="查找司机？来这里试试。" style="width: 200px"></i-input> -->
    <auto-complete :on-change="getSearchList" class="map-search" style="position: absolute;width: 240px;" v-model="searchValue"
        icon="ios-search" placeholder="查找司机？来这里试试。">
        <div>
            <i-option v-for="option in searchItems" :value="option" :key="option">
                <p class="Track">
                    <span> {{ option }} </span>
                    <i-button v-if="option !== '好像没有这个'" v-on:click="modalClick(option)" size="small" icon="paper-airplane">追踪</i-button>
                </p>
            </i-option>
        </div>
    </auto-complete>
    <Card class="map-card" v-show="hasTrckRun" style="width:350px;position: absolute">
        <p slot="title">
            <Icon type="android-car"></Icon>
            当前监控车辆列表(数量:{{ drivingCount }})
            <span>
                <i-button @click="flashAllTruck" style="float:right" size="small" icon="loop"></i-button>
            </span>
        </p>
        <ul>
            <li v-for="d in allRunInterval" style="height:30px;line-height:30px;" @click="showTruckAndBourns( d.truckid)">
                <a target="_blank" v-on:click="listOrderInfo(d.truckid)">{{ d.truckid }}</a>
                <span style="float:right">
                    <button-group>
                        <i-button size="small" type="ghost" icon="ios-location-outline" v-on:click="locationTruckById(d.truckid)"></i-button>
                        <i-button size="small" type="ghost" icon="ios-minus-empty" v-on:click="clearOneTruckLine(d.truckid)"></i-button>
                    </button-group>
                </span>
            </li>
        </ul>
    </Card>
    <Modal v-model="modal" title="车辆追踪" width="" @on-ok="setOrderlocation">
        <div v-show="modalTool" style="text-align:center">
            <Row>
                <i-col span="7">
                    <div class="calendar">
                        <div class="top-block">
                            <div id="a">
                                <button class="left-btn" v-on:click="nowYear--">
                                    &nbsp;&nbsp;&nbsp;&nbsp;</button>
                                        {{ nowYear }}年
                                        <button class="right-btn" v-on:click="nowYear++">&nbsp;&nbsp;>&nbsp;&nbsp;</button>
                            </div>
                            <div>
                                <button class="left-btn" v-on:click="nowMonth--">
                                     &nbsp;&nbsp;&nbsp;&nbsp;</button>
                                        {{ nowMonth }}月
                                        <button class="right-btn" v-on:click="nowMonth++">&nbsp;&nbsp;>&nbsp;&nbsp;</button>
                            </div>
                        </div>
                        <div class="week-blocks">
                            <span class="week-block" v-for="w in week">{{ w }}</span>
                        </div>
                        <div class="day-blocks" id="b">
                            <button class="day-block" :id="getDateId(nowYear,nowMonth,d)" v-for="d in nowDay" v-on:click="handleChange(nowYear + '-' + nowMonth + '-' + d)" disabled>{{ d }}</button>
                        </div>
                    </div>
                <!-- <date-picker
                    :open="open"
                    :value="modalDate"
                    type="date"
                    @on-change="handleChange"
                    style="height:300px">   
                </date-picker>
            <i-button size="small" v-on:click="orderInfo">追踪</i-button> -->
            <p style="text-align:center">
                <!-- <i-button v-on:click="listOrderInfo(modalId)">当前车辆: {{ modalId }}</i-button> -->
                <p>当前车辆:{{modalId}}</p>
                <p>司机：{{carname}}</p>
                <p>已送厂区：{{cardnum}}</p>
                <p>已运送订单：{{carnum}}</p>
            </p>
            </i-col>
                <i-col span="16"><i-table v-show="true" border stripe :columns="columns" :data="tabledate"></i-table></i-col>
            </Row>
        </div>
    </Modal>
    <div id="map"></div>
</div>
<script type="text/javascript" src="JS/page/map.js"></script>